var mongoose=require('mongoose')
mongoose.connect('mongodb://localhost/userInfo')
var Schmea=mongoose.Schema
var userSchema=new Schmea({
    email:{type:String,required:true},
    nickname:{type:String,required:true},
    password:{type:String,required:true},
    create_time:{type:Date,default:Date.now},
    last_modified_time:{type:Date,default:Date.now},
    avatar:{type:String,default:'/public/img/avatar-default.png'}, //url地址
    bio:{type:String,default:''},
    gender:{type:Number,enum:[-1,0,1],default:-1},
    birthday:{type:Date},
    status:{type:Number,enum:[0,1,2],default:0} //0没有权限限制 1不可以评论 2不可以登陆

})
module.exports=mongoose.model('User',userSchema)
